﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class gendan_made : System.Web.UI.Page
{
    protected Model.CMember loginUserInfo = null;
    protected int id = ReadRequest.RequestInt("id");
    private int userid = ReadRequest.RequestInt("UserID");
    protected Model.LotteryChipped buyInfo = null;
    protected string NickName = "";
    protected DataTable dingzhiJE = null;
    protected DataTable LotteryUserDt = null;
    protected long User_Id;//当前用户ID
    protected DataTable dingzhiRS = null;
    protected DataTable LotteryChippedTb = null;
    private int Gendanmoneyid = ReadRequest.RequestInt("id");
    protected DataTable allmoney = null;
    protected void Page_Load(object sender, EventArgs e)
    {
        loginUserInfo = BLL.CMember.UserLoginInfo();
        if (loginUserInfo == null)
        {
            ////跳转到会员登录页
            if (IsPostBack)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "login", "<script type=\"text/javascript\">login();</script>");
               
            }
               
        }
        else
        {
            User_Id = loginUserInfo.Id;
        }
        databind(id);

    }

    /// 本方案已跟单人数
    /// </summary>
    /// <param name="Id"></param>
    /// <returns></returns>
    public int chakan_count(int Id)
    {
        int chakanCount = BLL.LotteryChippedUser.GetAll_Count(Id);
        return chakanCount;
    }
    private void databind(long id)
    {
        string sqlstr = "select a.LotteryType,LotteryJD,b.winTotal,b.modellevel,c.nickname,c.photo from  ";
        sqlstr += "LotteryChipped a left join UsersAccount b on a.UserID = b.user_id left join CMember c on c.Id = b.user_id  ";
        sqlstr += "where a.id = " + id + "";
        LotteryUserDt = BLL.LotteryChipped.GetPageListBysql(sqlstr);
    }

    private void user()
    {
        string sql = "";


    }

    public string ViewModelLevel(long modellevel)
    {
        string divs = BLL.LotteryChipped.ViewModelLevelByModel(modellevel);
        return divs;

    }

   
}